home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / 3D Buttons CDEF 1.0b6 / Source / 3D Buttons CDEF source / (3D CDEF++.68k.π) / LColorTable.h < prev    next >
Text File  |  1994-12-28  |  2KB  |  92 lines

  1. /*
  2.     Public domain by Zig Zichterman.
  3. */
  4. /*
  5.     LColorTable
  6.     
  7.     A color table from control's or window's auxilliary 
  8.     color info.
  9.     
  10.     This class "borrows" the color table handle--it does
  11.     not own the color table handle, it does not dispose it.
  12.     The control or window would be very upset if that
  13.     happened.
  14.     
  15.     CCTabHandle and CTabHandle share the same format,
  16.     so this class works fine for control or window
  17.     custom color tables.
  18.     
  19.     12/27/94    zz    h    rename from LGBColorTable
  20.     11/27/94    zz    h    initial write
  21. */
  22. #pragma once
  23.  
  24. #include <Controls.h>
  25.  
  26. class LColorTable
  27. {
  28.     public :
  29.         // part constants for control and
  30.         // window auxilliary color tables
  31.         typedef enum {
  32.             // cctb/::GetAuxCtl()
  33.             Part_ControlFrame                =  0,
  34.             Part_ControlBody                =  1,
  35.             Part_ControlText                =  2,
  36.             Part_ControlThumb                =  3,
  37.             Part_ControlFillPatternColor    =  4,
  38.             Part_ControlArrowScrollBGLight    =  5,
  39.             Part_ControlArrowScrollBGDark    =  6,
  40.             Part_ControlThumbLight            =  7,
  41.             Part_ControlThumbDark            =  8,
  42.             Part_ControlHighlightLight        =  9,
  43.             Part_ControlHighlightDark        = 10,
  44.             Part_ControlTitleBarLight        = 11,
  45.             Part_ControlTitleBarDark        = 12,
  46.             Part_ControlTingeLight            = 13,
  47.             Part_ControlTingeDark            = 14,
  48.             
  49.             // wctb/actb/dctb/::GetAuxWin()->awCTable/::
  50.             Part_WindowContent                =  0,
  51.             Part_WindowFrame                =  1,
  52.             Part_WindowText                    =  2,
  53.             Part_WindowHighlight            =  3,
  54.             Part_WindowTitleBar                =  4,
  55.             Part_WindowStripesTextLight        =  5,
  56.             Part_WindowStripesTextDark        =  6,
  57.             Part_WindowTitleBarBGLight        =  7,
  58.             Part_WindowTitleBarBGDark        =  8,
  59.             Part_WindowDialogBevelFrameLight=  9,
  60.             Part_WindowDialogBevelFrameDark    = 10,
  61.             Part_WindowTingeLight            = 11,
  62.             Part_WindowTingeDark            = 12,
  63.  
  64.             Part_Unknown                    = 0xFFFF
  65.         } PartT;
  66.  
  67.  
  68.         LColorTable(void);
  69.         
  70.         void
  71.         GetControlColors(
  72.             const ControlHandle    inControlH);
  73.         
  74.         void
  75.         GetWindowColors(
  76.             const WindowPtr    inWindow);
  77.         
  78.         inline Boolean
  79.         HasColors(void) const
  80.         {    return mColorTable != NULL;    }
  81.         
  82.         Boolean                                // did we get a color
  83.         GetColorForPart(
  84.             PartT        inPart,                // content, frame, etc.
  85.             RGBColor    &outColor) const;    // returned color
  86.             
  87.     
  88.  
  89.     protected :
  90.         CTabHandle    mColorTable;
  91. };
  92.